package com.zcdom.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zcdom.system.entity.User;
import com.zcdom.system.mapper.UserMapper;
import com.zcdom.system.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper,User> implements IUserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User selectUserById(Long id) {
        return super.getById(id);
    }

    @Override
    public User selectUserByUsername(String username) {
        //return super.getOne(new QueryWrapper<User>().eq("username",username));
        return userMapper.selectOne(new QueryWrapper<User>().eq("username",username));
    }
}
